//
//  VolumeViewController.m
//  10705storyboard
//
//  Created by student on 16/2/22.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "VolumeViewController.h"
extern int calCount;
@interface VolumeViewController ()
@property (weak, nonatomic) IBOutlet UITextField *length;
@property (weak, nonatomic) IBOutlet UITextField *width;
@property (weak, nonatomic) IBOutlet UITextField *height;
@property (weak, nonatomic) IBOutlet UITextField *rectVolume;
@property (weak, nonatomic) IBOutlet UITextField *radius;
@property (weak, nonatomic) IBOutlet UITextField *circleVolume;

@end

@implementation VolumeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)cal:(id)sender {
    float volume = [self.length.text floatValue] * [self.width.text floatValue] * [self.height.text floatValue];
    self.rectVolume.text = [NSString stringWithFormat:@"%.2f",volume];
    
    float volume2 = [self.radius.text floatValue] * [self.radius.text floatValue] * [self.radius.text floatValue] * M_PI;
    self.circleVolume.text = [NSString stringWithFormat:@"%.2f",volume2];
    calCount++;
}
- (IBAction)backgroundTag:(id)sender {
    [self.view endEditing:YES];
}

@end
